import { localCache } from '@/utils/cache'
import { createRouter, createWebHistory } from 'vue-router'
import { LOGIN_TOKEN } from '@/global/constants'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/home/home.vue'),
      redirect: '/homePage',
      children: [
        {
          path: '/homePage',
          name: 'homePage',
          component: () => import('../views/homePage/homePage.vue'),
          meta: {
            navBanner: false,
            Search: false
          }
        },
        {
          path: '/study',
          name: 'study',
          component: () => import('../views/study/study.vue'),
          meta: {
            navBanner: true,
            Search: true
          }
        },
        {
          path: '/project',
          name: 'project',
          component: () => import('../views/project/project.vue'),
          meta: {
            navBanner: true,
            Search: false
          }
        },
        {
          path: '/friends',
          name: 'friends',
          component: () => import('../views/friends/friends.vue'),
          meta: {
            navBanner: true,
            Search: false
          }
        },
        {
          path: '/stoneLog',
          name: 'stoneLog',
          component: () => import('../views/stoneLog/stone-log.vue'),
          meta: {
            navBanner: true,
            Search: false
          }
        },
        {
          path: '/moment/:id',
          name: 'moment',
          component: () => import('../views/study/c-cps/moment.vue'),
          meta: {
            navBanner: true,
            Search: false
          }
        },
        {
          path: '/life/:id',
          name: 'life',
          component: () => import('../views/stoneLog/c-cps/life.vue'),
          meta: {
            navBanner: true,
            Search: false
          }
        }
      ]
    },
    {
      path: '/:pathMatch(.*)',
      component: () => import('../views/notfound/notfound.vue'),
      
    },
    {
      path: '/information',
      component: () => import('../views/information/information.vue'),
    },
    {
      path: '/login',
      component: () => import('../views/login/login.vue'),
    }
  ]
})



export default router
